//
//  HomePageDetail.swift
//
//  Created by 邱仙凯 on 2021/9/27
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct ZyaHomePageDetail: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let orgName = "org_name"
    static let sSockMoney = "s_sock_money"
    static let idKey = "id_key"
    static let sNo = "s_no"
    static let typename = "typename"
    static let sDate = "s_date"
    static let contractNo = "contract_no"
    static let sMonth = "s_month"
    static let sYfMoney = "s_yf_money"
    static let sDfMoney = "s_df_money"
    static let type = "type"
    static let supplierId = "supplier_id"
  }

  // MARK: Properties
  public var orgName: String?
  public var sSockMoney: Float?
  public var idKey: Int?
  public var sNo: String?
  public var typename: String?
  public var sDate: String?
  public var contractNo: String?
  public var sMonth: String?
  public var sYfMoney: Int?
  public var sDfMoney: Float?
  public var type: Int?
  public var supplierId: Int?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    orgName <- map[SerializationKeys.orgName]
    sSockMoney <- map[SerializationKeys.sSockMoney]
    idKey <- map[SerializationKeys.idKey]
    sNo <- map[SerializationKeys.sNo]
    typename <- map[SerializationKeys.typename]
    sDate <- map[SerializationKeys.sDate]
    contractNo <- map[SerializationKeys.contractNo]
    sMonth <- map[SerializationKeys.sMonth]
    sYfMoney <- map[SerializationKeys.sYfMoney]
    sDfMoney <- map[SerializationKeys.sDfMoney]
    type <- map[SerializationKeys.type]
    supplierId <- map[SerializationKeys.supplierId]
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = orgName { dictionary[SerializationKeys.orgName] = value }
    if let value = sSockMoney { dictionary[SerializationKeys.sSockMoney] = value }
    if let value = idKey { dictionary[SerializationKeys.idKey] = value }
    if let value = sNo { dictionary[SerializationKeys.sNo] = value }
    if let value = typename { dictionary[SerializationKeys.typename] = value }
    if let value = sDate { dictionary[SerializationKeys.sDate] = value }
    if let value = contractNo { dictionary[SerializationKeys.contractNo] = value }
    if let value = sMonth { dictionary[SerializationKeys.sMonth] = value }
    if let value = sYfMoney { dictionary[SerializationKeys.sYfMoney] = value }
    if let value = sDfMoney { dictionary[SerializationKeys.sDfMoney] = value }
    if let value = type { dictionary[SerializationKeys.type] = value }
    if let value = supplierId { dictionary[SerializationKeys.supplierId] = value }
    return dictionary
  }

}
